package leetcode;

import java.util.Arrays;

public class LC41 {
    public static void main(String[] args) {

    }
    public TreeNode sortedArrayToBST(int[] nums) {
        return tn(nums,0,nums.length);
    }
    public TreeNode tn(int[] nums , int left ,int right){
        int mid = (left+right) >> 1;
        TreeNode node = new TreeNode(nums[mid]);
        node.left = tn(nums,left,mid-1);
        node.right = tn(nums,mid+1,right);
        return node;
    }
}
